/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Business;

import GUI.Welcome;
import javax.swing.JFrame;
import javax.swing.JOptionPane;

/**
 *
 * @author Rubik Levitsky
 */
public class NoToolbarFrame implements FrameType
{
       private JFrame _currentFrame;
    private JFrame _previousFrame;

       public NoToolbarFrame()
       {
       }

    @Override
         public void initiateFrame()
        {
           _currentFrame = new Welcome();
            _currentFrame.setVisible(true);
       }

    @Override
         public void dispose()
        {
            this._currentFrame.dispose();
        }


    @Override
       public synchronized void changeCurrentFrame(JFrame frame)
        {
           this._currentFrame.dispose();
           this. _currentFrame = frame;
           this._currentFrame.setVisible(true);
       }

    @Override
    public synchronized void showErrorMessage(String error)
    {
        JOptionPane.showMessageDialog(_currentFrame.getContentPane(), error, "Error", JOptionPane.ERROR_MESSAGE);
    }

    @Override
    public void initiateFrame(Object obj, int type)
    {
        throw new UnsupportedOperationException("Not supported yet.");
    }

        @Override
    public void showInfoMessage(String info) {
        JOptionPane.showMessageDialog(_currentFrame.getContentPane(), info, "INFO", JOptionPane.INFORMATION_MESSAGE);
    }


}
